  /****************************************** 
  	 初始化数据
  	*******************************************/
  //echart   
  var mucusChart;
  var mucusTitle = "宫颈粘液";
  var mucusPeriodTitle = "周期背景颜色";
  var gridX = 0;
  var gridY = 0;
  var gridX2 = 0;
  var gridY2 = 30;
  
  //X轴
  var currentDateStr;	
 
  var webviewWidth;
  var webviewHeight;
  var mucusChartHeightPercentage = 0.7;
	
  var PORTRAIT_SCALE_FACTOR = 9;
  var SCREEN_WIDTH_SCALE = 3;  
  
  var portraitBeforeShowDaysNum = Math.round((SCREEN_WIDTH_SCALE * PORTRAIT_SCALE_FACTOR - 1) / 2);
  var portraitAfterShowDaysNum = Math.round((SCREEN_WIDTH_SCALE * PORTRAIT_SCALE_FACTOR - 1) / 2);
  var showDaysTotalNum = portraitBeforeShowDaysNum + portraitAfterShowDaysNum;  

  var xAxisDateArray = new Array();
  
  var mucusDataArray = new Array();
  
  //Y轴
  var yAxisLength;
  var yAxisTickLength;
  var yAxisMinMucus = 0;
  var yAxisMaxMucus = 4;
  var yAxisSplitNumber = 4;
  var yAxisMargin = -45;

  //背景色
  var yjqBackgroundColor = 'rgba(255,232,232,0.8)';
  var lpqBackgroundColor = 'rgba(198,226,255,0.8)';
  var plqBackgroundColor = 'rgba(232,247,225,0.8)';
  var htqBackgroundColor = 'rgba(255,250,205,0.8)';
  var unknownBackgroundColor = 'rgba(255,255,255,0.8)';
 
  
  function initMucusChartData(){
		initMucusChartZone();
		initXAxisData();
		initYAxisData();	
		initYAxisDiv();
	}
	
	function initMucusChartZone(){
    	webviewWidth = getScreenWidth();
    	webviewHeight = getScreenHeight();
 
    	mucusChartHeight = webviewHeight * mucusChartHeightPercentage;		
		mucusChartWidth = webviewWidth;
		
		setMucusChartFixZone(mucusChartWidth, mucusChartHeight);
		setMucusChartScrollZone(mucusChartWidth, mucusChartHeight);

    	setMucusChartSreen(mucusChartWidth, mucusChartHeight);    	
    }
    
    function getScreenWidth(){
    	return window.innerWidth;
    }
    
    function getScreenHeight(){
    	return window.innerHeight;
    }
    
    function setMucusChartFixZone(mucusChartWidth, mucusChartHeight){
    	document.getElementById('div_fix_zone').style.width = mucusChartWidth + "px";
    	document.getElementById('div_fix_zone').style.height = mucusChartHeight + "px";
    }
    
    function setMucusChartScrollZone(mucusChartWidth, mucusChartHeight){
    	document.getElementById('div_scroll_zone').style.width = mucusChartWidth + "px";
    	document.getElementById('div_scroll_zone').style.height = mucusChartHeight + "px";
    }
    
    function setMucusChartSreen(mucusChartWidth, mucusChartHeight){
    	document.getElementById('mucusChart').style.width = mucusChartWidth * SCREEN_WIDTH_SCALE + "px";
    	document.getElementById('mucusChart').style.height = mucusChartHeight + "px";
    }
    
	
	//x轴数据初始化
    function initXAxisData(){   	
		currentDateStr = getCurrentDateStr();
		xAxisDateArray = getRoundDate(currentDateStr, portraitBeforeShowDaysNum, portraitAfterShowDaysNum);								
    }
								   
	function initYAxisData(){
    	for(var i = 0; i < xAxisDateArray.length; i++){
    		mucusDataArray[i] = customerDateMucusMap.get(xAxisDateArray[i]);
    	}
    }

    function initYAxisDiv(){   	
    	yAxisLength = mucusChartHeight - gridY - gridY2;
    	yAxisTickLength = yAxisLength / yAxisSplitNumber;
    	document.getElementById('mucusChartYAxisTable').style.height = yAxisLength + "px";	    	      	
    	document.getElementById('mucusChartYAxis').style.marginTop = gridY + "px";
    	document.getElementById('mucusChartYAxis').style.marginBottom = gridY2 + "px";
    	document.getElementById('mucusChartYAxis').style.height = yAxisLength + "px";
    }